package com.s59.players.service.impl;

import com.s59.players.entity.Players;
import lombok.val;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;

import javax.xml.ws.Action;
import java.util.List;

@Service
public class PlayMongoService {
    @Autowired
    public MongoTemplate mongoTemplate;

    public void save(Players player){
        mongoTemplate.save(player,"players");
    }

    public List<Players> findAll(){
        return mongoTemplate.findAll(Players.class,"players");
    }

}
